package vn.wallet.app.service.impl;

// Generated Oct 23, 2012 10:05:44 PM by Hibernate Tools 3.4.0.CR1

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.wallet.app.dao.ICurrencyDAO;
import vn.wallet.app.domain.Currency;
import vn.wallet.app.service.ICurrencyService;

@Transactional
@Service
public class CurrencyService implements ICurrencyService {

	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(CurrencyService.class);

	@Autowired
	ICurrencyDAO currencyDAO;

	@Override
	public Currency getById(int id) throws Exception {
		return currencyDAO.getById(id);
	}

	@Override
	public void delete(Currency obj) throws Exception {
		currencyDAO.delete(obj);
	}

	@Override
	public void delete(int id) throws Exception {
		currencyDAO.delete(id);
	}

	@Override
	public void update(Currency obj) throws Exception {
		currencyDAO.update(obj);
	}

	@Override
	public void save(Currency obj) throws Exception {
		currencyDAO.save(obj);
	}

	@Override
	public List<Currency> getAll() throws Exception {
		return currencyDAO.getAll();
	}

	@Override
	public List<Currency> getAllByUserId(int userId) throws Exception {
		return currencyDAO.getAllByUserId(userId);
	}

	@Override
	public List<?> findByExample(Currency obj) throws Exception {
		return currencyDAO.findByExample(obj);
	}

	public ICurrencyDAO getCurrencyDAO() {
		return currencyDAO;
	}

	public void setCurrencyDAO(ICurrencyDAO currencyDAO) {
		this.currencyDAO = currencyDAO;
	}

}
